<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>计算盒子宽度-calc()</title>

    <style>

        .father {
            width: 1200px;
            height: 200px;
            background-color: pink;
        }

        .son {
            width: calc(100% - 30px);
            height: 30px;
            background-color: skyblue;
        }

    </style>

</head>
<body>
    
    <h3>子盒子比父盒子小30px</h3>
    <div class="father">
        <div class="son"></div>
    </div>

</body>
</html>